<div data-ng-controller="contractDredgeCtrl">
    <div class="table-header clearfix ng-scope">
        <span class="fl lh30 f14 ml20">{{contractBaseInfo.contract_code}}</span>
    </div>
    <div class="ml20 c-blue lh30 f16">
        签约金额：{{amountInfo.signed}} 应结算金额：{{amountInfo.receivable}} 已结算金额：{{amountInfo.received}}
    </div>
    <form class="form-horizontal">
        <div class="section-title c-orange ml10 mt10">
            <span class="ml10">基本信息</span>
        </div>
        <div class="form-group mt10">
            <span class="col-sm-3 control-label ml15">租户名称</span>

            <div class="col-sm-9">
                <input ng-model="dredges.friendlyName" ng-disabled="true" class="form-control" type="text" />
            </div>
        </div>
        <div class="form-group mt10">
            <span class="col-sm-3 control-label ml15">企业号</span>

            <div class="col-sm-9">
                <input ng-model="dredges.uniqueName" ng-disabled="true" class="form-control" type="text" />
            </div>
        </div>
    </form>
    <div class="section-title c-orange ml10 mt10">
        授权汇总
    </div>
    <div class="table-wrap mt10 ml25" style="min-height: 200px;">
        <table width="100%">
            <thead>
                <tr>
                    <th width="40">序号</th>
                    <th width="180">开通时间</th>
                    <th width="180">已结算金额</th>
                    <th width="180">应用名称</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="record in summaryAuthorizeList">
                    <td height="40">
                        <p ng-bind="$index + 1"></p>
                    </td>
                    <td class="lh14">
                        {{record.PerformanceAccountingTime}}
                    </td>
                    <td class="lh14">
                        {{record.summaryReceived}}
                    </td>
                    <td class="lh14">
                        {{record.applicationName}}
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="no-data" ng-if="!summaryAuthorizeList || summaryAuthorizeList.length === 0"><span>暂无数据</span></div>
    </div>
    
    <div class="ml10 mt10 clearfix">
        <div class="section-title fl c-orange">
           授权信息
        </div>
        <button href="javascript:;" class="btn fr" ng-if="contractBaseInfo.contract_status !== 0" ng-click="add()">
            新增
        </button>
    </div>
    <div id="grid" class="table-wrap mt10 ml25" style="min-height: 200px;">
        <table width="100%">
            <thead>
                <tr>
                    <th width="40">序号</th>
                    <th width="180">应用名称</th>
                    <th width="180">授权项目数</th>
                    <th width="180">租期</th>
                    <th width="100" class="align-r">开通时间</th>
                    <th width="100" class="align-m">业绩核算时间</th>
                    <th width="100" class="align-m">结算金额</th>
                    <th width="100" class="align-m">签约金额</th>
                    <th width="100" class="align-m">合同属性</th>
                    <th width="50" class="align-m">出库单号</th>
                    <th width="60" class="align-m">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="record in dredges.AuthorizeList">
                    <td height="40">
                        <p ng-bind="$index + 1"></p>
                    </td>
                    <td class="lh14">
                        <p ng-bind="record.applicationName"></p>
                    </td>
                    <td class="lh14">
                        <p ng-bind="record.totalNum|number"></p>
                    </td>
                    <td class="lh14">
                        <p ng-if="record.buss_type_id == '7f94a5d3-fcf6-11e4-bed8-00155d02c832'">
                            -
                        </p>
                        <p ng-if="record.buss_type_id != '7f94a5d3-fcf6-11e4-bed8-00155d02c832'">
                            <span ng-bind="record.beginOn|strdate:'yyyy-MM-dd'"></span> 
                            至
                            <span ng-bind="record.endOn|strdate:'yyyy-MM-dd'"></span>
                        </p>
                    </td>
                    <td class="align-r">
                        <p ng-bind="record.performanceAccountingTime|strdate:'yyyy-MM-dd'"></p>
                    </td>
                    <td class="align-r">
                        <p ng-bind="record.establishTime|strdate:'yyyy-MM-dd'"></p>
                    </td>
                    <td class="align-m">
                        {{record.settlement_amount}}
                    </td>
                    <td class="align-m">
                        {{record.sign_amount}}
                    </td>
                    <td class="align-m">
                        {{record.contract_type | productTypeFormat}}
                    </td>
                    <td class="align-m">
                        <a ng-if="record.OrderGUID!='' && record.OrderGUID!=null" ng-href="{{joint_url}}{{record.OrderGUID}}" target="_blank">{{record.OrderCode}}</a>
                        <p ng-if="(record.OrderGUID==''||record.OrderGUID==null)" ng-bind="record.OrderCode"></p>
                    </td>
                    <td class="align-m">
                        <a href="javascript:;" ng-click="update(record)">
                            修改
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="no-data" ng-if="!dredges.AuthorizeList || dredges.AuthorizeList.length === 0"><span>暂无数据</span></div>

    </div>
</div>